package com.yuju.group.enums;

/**
 * 
 * 类名：GroupReturnCodeEnum  <br />
 *
 * 功能：员工业务代码枚举
 *
 * @author : zhousc <br />
 * @Date : 2017年11月23日 上午10:40:51  <br />
 * @version : 1.1 <br />
 */
public enum EmployeeReturnCodeEnum {
	EMPLOYEE_QUERY_SUCCESS("yuju-employee-1000", "员工信息查询成功"),
	EMPLOYEE_QUERY_FAILURE("yuju-employee-1001", "员工信息查询失败"),
	EMPLOYEE_SAVE_SUCCESS("yuju-employee-1002", "员工信息保存成功"),
	EMPLOYEE_SAVE_FAILURE("yuju-employee-1003", "员工信息保存失败"),
	EMPLOYEE_UPDATE_SUCCESS("yuju-employee-1004", "员工信息更新成功"),
	EMPLOYEE_UPDATE_FAILURE("yuju-employee-1005", "员工信息更新失败"),
	EMPLOYEE_DEL_SUCCESS("yuju-employee-1006", "员工信息删除成功"),
	EMPLOYEE_DEL_FAILURE("yuju-employee-1007", "员工信息删除失败"),
	EMPLOYEE_GETEMPCODE_SUCCESS("yuju-employee-1008", "员工编号获取成功"),
	EMPLOYEE_GETEMPCODE_FAILURE("yuju-employee-1009", "员工编号获取失败"),
	EMPLOYEE_DEPARTMENTTREE_SUCCESS("yuju-employee-1010", "部门树获取成功"),
	EMPLOYEE_DEPARTMENTTREE_FAILURE("yuju-employee-1011", "部门树获取失败"),
	EMPLOYEE_DEL_FAILURE_BY_OP("yuju-employee-1012", "该员工有关联的账号，不可删除");
	
	private String code;
	private String desc;
	
	EmployeeReturnCodeEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	public static String getDescByCode(String code) {
		for (EmployeeReturnCodeEnum enume : EmployeeReturnCodeEnum.values()) {
			if (enume.getCode().equals(code)) {
				return enume.getDesc();
			}
		}
		
		return "未知枚举类型";
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}